package cn.zkc.library.service;

import cn.zkc.library.dao.TicketDAO;
import cn.zkc.library.modal.Ticket;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author kay
 * @version 1.0
 * @date 2020/6/27 18:07
 * @description
 */
@Service
public class TicketService {

    @Autowired
    private TicketDAO ticketDAO;

    public void addTicket(Ticket t){
        ticketDAO.addTicket(t);
    }
    public Ticket getTicket(int uid){
        return ticketDAO.selectByUserId(uid);
    }
    public Ticket getTicket(String t){
        return ticketDAO.selectTicket(t);
    }
    public void deleteTicket(int tid){
        ticketDAO.deleteTicketById(tid);
    }

}
